/**
 * File Name	: BaseContext.java
 * Author		: Adelwin Handoyo
 * Create Date	: May 1, 2010:11:39:21 AM
 *
 */

package org.jampang.base.context;

import java.io.Serializable;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class BaseContext implements Serializable {

	private static final long serialVersionUID = 2396811219826924473L;
	private Map<String, Object> attributes = new HashMap<String, Object>();

	public void setAttribute(String key, Object value) {
		attributes.put(key, value);
	}

	public Object getAttribute(String key) {
		return attributes.get(key);
	}

	public Set<String> getKeySet() {
		return attributes.keySet();
	}

	public boolean containsKey(String key) {
		return attributes.containsKey(key);
	}

	public boolean containsValue(Object value) {
		return attributes.containsValue(value);
	}

	public void clearAttributes() {
		attributes.clear();
	}

	public Collection<Object> attributeValues() {
		return attributes.values();
	}

	public void remove(String key) {
		attributes.remove(key);
	}
}
